using UnityEngine;

public class MushroomPickaxe : Pickaxe
{

    [Range(0.0f, 1.0f)]
    public float possibilityOfBonusMushroom;
    
    public override void Collect(HealthProp healthProp)
    {
        healthProp.DoDamage(collectPower);
        PlayerProp.Instance.endurance -= enduranceCost;

        var entity = healthProp.transform.GetComponent<GridEntity>();
        if (healthProp.hp <= 0 
            && entity.entityTag.StartsWith("mushroom") 
            && Random.Range(0.0f, 1.0f) < possibilityOfBonusMushroom)
        {
            // get a bonus mushroom
            Debug.Log("you get a bonus mushroom, but not implemented!");
        }
    }
    public override void Attack(HealthProp healthProp)
    {
        healthProp.DoDamage(attackPower);
        PlayerProp.Instance.endurance -= enduranceCost;
    }
}
